#region License
// /* **************************************************************
// * Copyright (C) intex Consulting GmbH - All Rights Reserved    *
// *--------------------------------------------------------------*
// * Unauthorized copying of this file, via any medium is         *
// * strictly prohibited                                          *
// *--------------------------------------------------------------*
// * Proprietary and confidential                                 *
// *--------------------------------------------------------------*
// * Dissasembling/modifications strictly prohibited!             *
// ***************************************************************/
#endregion
using System.Diagnostics.CodeAnalysis;
using ComHlp.enums;

namespace ComHlp.ContentClasses.Bs
{
    /// <summary> ykomm.cpy representation </summary>
    [SuppressMessage("ReSharper", "UnusedMember.Global")]
    [SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global")]
    public class BsHeader
    {
        /// <summary> mapname
        /// 30  YKOMM-FDNAME           PIC X(008).</summary>
        public string MapName { get; set; }

        private const int MapNamePos = 0;
        private const int MapNameLength = 8;


        /// <summary> 30  YKOMM-KBB-RESTB        PIC X(048).</summary>
        public string RestB { get; set; }

        private const int RestBPos = MapNamePos + MapNameLength;
        private const int RestBPosLength = 48;

        /// <summary> logged on userid 
        /// 30  YKOMM-KBB-BENID        PIC X(008).</summary>
        public string UserId { get; set; }

        private const int UserIdPos = RestBPos + RestBPosLength;
        private const int UserIdLength = 8;

        /// <summary> function keys enabled/disabled string - handled in static 
        /// 30  YKOMM-BS-FTASTEN       PIC X(020). </summary>
        public string FuncKeys { get; set; }

        private const int FuncKeysPos = UserIdPos+UserIdLength;
        private const int FuncKeysLength = 20;

        // redefinition....
        ///// <summary> 30  YKOMM-KBF-FORMAT       PIC X(316).</summary>
        //public string Format { get; set; }
        //public const int FormatPos = FuncKeysPos+FuncKeysLength;
        //public const int FormatLength = 316;

        /// <summary> 35 YKOMM-RECT-IND         PIC 9(004).</summary>
        public string RectInd { get; set; }
        public const int RectIndPos = FuncKeysPos+FuncKeysLength;
        public const int RectIndLength = 4;

        /// <summary> 35 YKOMM-VONY-NEU         PIC 9(004).</summary>
        public string StartYNew { get; set; }

        private const int StartYNewPos = RectIndPos+RectIndLength;
        private const int StartYNewLength = 4;

        /// <summary> 35 YKOMM-VONX-NEU         PIC 9(004).</summary>
        public string StartXNew { get; set; }

        private const int StartXNewPos = StartYNewPos+StartYNewLength;
        private const int StartXNewLength = 4;

        /// <summary> 35 YKOMM-VONY-ALT         PIC 9(004).</summary>
        public string StartYOld { get; set; }

        private const int StartYOldPos = StartXNewPos+StartXNewLength;
        private const int StartYOldLength = 4;

        /// <summary> 35 YKOMM-VONX-ALT         PIC 9(004).</summary>
        public string StartXOld { get; set; }

        private const int StartXOldPos = StartYOldPos+StartYOldLength;
        private const int StartXOldLength = 4;

        /// <summary> 35 YKOMM-Z-NEU            PIC 9(004).</summary>
        public string ZNew { get; set; }

        public const int ZNewPos = StartXOldPos+StartXOldLength;
        public const int ZNewLength = 4;

        /// <summary> 35 YKOMM-S-NEU            PIC 9(004).</summary>
        public string SNew { get; set; }

        public const int SNewPos = ZNewPos+ZNewLength;
        public const int SNewLength = 4;

        /// <summary> 35 YKOMM-Z-ALT            PIC 9(004).</summary>
        public string ZOld { get; set; }

        public const int ZOldPos = SNewPos+SNewLength;
        public const int ZOldLength = 4;

        /// <summary> 35 YKOMM-S-ALT            PIC 9(004). </summary>
        public string SOld { get; set; }

        public const int SOldPos = ZOldPos+ZOldLength;
        public const int SOldLength = 4;

        /// <summary> used to return the value of clicked bar/piepiece in hp10
        /// 35 YKOMM-RECT-IND2        PIC 9(008).</summary>
        public string RectInd2ClickedChartValue { get; set; }
        public const int RectInd2Pos = SOldPos+SOldLength;
        public const int RectInd2Length = 8;

        /// <summary> startprog to sent to the server - AFTER FORMATINFO of ykomm (thus +316)
        /// 30  YKOMM-STARTPROG        PIC X(004).</summary>
        public string StartProg { get; set; }

        private const int StartProgPos = FuncKeysPos + FuncKeysLength + 316;
        private const int StartProgLength = 4;

        /// <summary> 30  YKOMM-RESERVE2         PIC X(004). </summary>
        public string Reserve2 { get; set; }

        private const int Reserve2Pos = StartProgPos+StartProgLength;
        private const int Reserve2Length = 4;

        /// <summary> map got graphic area 
        /// 30  YKOMM-GRAFIK           PIC X(001).</summary>
        public bool Graphic { get; set; }

        private const int GraphicPos = Reserve2Pos+Reserve2Length;
        private const int GraphicLength = 1;

        /// <summary> 30  YKOMM-DATKZ            PIC X(001).</summary>
        public char DatKz { get; set; }

        private const int DatKzPos = GraphicPos+GraphicLength;
        private const int DatKzLength = 1;

        /// <summary> 30  YKOMM-LV-NR-SCROLL     PIC 9(001).</summary>
        public char ListViewScroll { get; set; }

        public const int ListViewScrollPos = DatKzPos+DatKzLength;
        public const int ListViewScrollLength = 1;

        /// <summary> 30  YKOMM-MOUSE-LR         PIC X(001).</summary>
        public char MouseLr { get; set; }

        private const int MouseLrPos = ListViewScrollPos+ListViewScrollLength;
        private const int MouseLrLength = 1;

        /// <summary> 30  YKOMM-MENUINFO         PIC X(001).</summary>
        public char MenuInfo { get; set; }

        private const int MenuInfoPos = MouseLrPos+MouseLrLength;
        private const int MenuInfoLength = 1;

        /// <summary> bs listview on map 
        /// 30  YKOMM-LISTVIEW         PIC X(001).</summary>
        public bool ListView { get; set; }

        private const int ListViewPos = MenuInfoPos+MenuInfoLength;
        private const int ListViewLength = 1;

        /// <summary> datalink (1=available/allowed, 2=existing)
        /// 30  YKOMM-DATALINK         PIC X(001). </summary>
        public DataLinkState DataLink { get; set; }

        private const int DataLinkPos = ListViewPos+ListViewLength;
        private const int DataLinkLength = 1;

        /// <summary> 30  YKOMM-SERVER-TRACE     PIC X(001).</summary>
        public char ServerTrace { get; set; }

        private const int ServerTracePos = DataLinkPos+DataLinkLength;
        private const int ServerTraceLength = 1;

        /// <summary> 30  YKOMM-OEM-KONV         PIC X(001).</summary>
        public char OemConv { get; set; }

        private const int OemConvPos = ServerTracePos+ServerTraceLength;
        private const int OemConvLength = 1;

        /// <summary> J = display werkzugehoerigkeit icon
        /// 30  YKOMM-DLZUORD          PIC X(001).</summary>
        public char DlZuord { get; set; }

        private const int DlZuordPos = OemConvPos+OemConvLength;
        private const int DlZuordLength = 1;

        /// <summary> 30  YKOMM-MOUSE-MOVE       PIC X(001).
        /// J=MIT DER MOUSE WURDE VERSCHOBEN.
        /// VONY-NEU: NEUE ZEILE
        /// VONX-NEU: NEUE SPALTE
        /// VONY-ALT: ALTE ZEILE
        /// VONX-ALT: ALTE SPALTE
        /// RECT-IND: INDEX DES VERSCHOBENEN RECTANGLES</summary>
        public char MouseMove { get; set; }

        public const int MouseMovePos = DlZuordPos+DlZuordLength;
        public const int MouseMoveLength = 1;

        /// <summary> 30  YKOMM-MOUSE-GRAF       PIC X(001).
        /// J=MIT DER LINKEN MOUSE AUF BALKEN AUS HP10     - das is nicht wirklich wahr.....
        /// RECT-IND2: INDEX DES GEWAEHLTEN BALKENS AUS HP10 </summary>
        public char MouseGrafChartClicked { get; set; }
        public const int MouseGrafPos = MouseMovePos+MouseMoveLength;
        public const int MouseGrafLength = 1;

        /// <summary> 30  YKOMM-MGKZ-ANDERS      PIC X(001).</summary>
        public char QuantityMarkDifferent { get; set; }

        private const int QuantityMarkDifferentPos = MouseGrafPos+MouseGrafLength;
        private const int QuantityMarkDifferentLength = 1;

        /// <summary> 30  YKOMM-ZAEHLER-NULL     PIC 9(001).
        /// 1=1 NULL, 2=2 NULL, 3=both </summary>
        public int YKommCounterNullValue { get; set; }

        private const int YKommCounterNullValuePos = QuantityMarkDifferentPos+QuantityMarkDifferentLength;
        private const int YKommCounterNullValueLength = 1;

        /// <summary> 30  YKOMM-REST-ABHOLEN     PIC X(001).
        /// more data available from monp3 </summary>
        public bool RestAvalaible { get; set; }

        private const int RestAvalaiblePos = YKommCounterNullValuePos+YKommCounterNullValueLength;
        private const int RestAvalaibleLength = 1;

        /// <summary> 30  YKOMM-RESERVE          PIC X(003).
        /// not used.</summary>
        public string Reserve3 { get; set; }

        private const int Reserve3Pos = RestAvalaiblePos+RestAvalaibleLength;
        private const int Reserve3Length = 3;

        /// <summary> x pos of mouse 
        /// 30  YKOMM-BS-MOUSEX        PIC 9(004).</summary>
        public int MouseX { get; set; }

        private const int MouseXPos = Reserve3Pos+Reserve3Length;
        private const int MouseXLength = 4;

        /// <summary> y pos of mouse 
        /// 30  YKOMM-BS-MOUSEY        PIC 9(004).</summary>
        public int MouseY { get; set; }

        private const int MouseYPos = MouseXPos+MouseXLength;
        private const int MouseYLength = 4;

        /// <summary> 30  YKOMM-BS-CP            PIC 9(004). </summary>
        public int CursorPos { get; set; }
        public const int CursorPosPos = MouseYPos+MouseYLength;
        public const int CursorPosLength = 4;
    }
}